<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>每日站立会议</title>

<link rel="stylesheet" href="<%= request.getContextPath() %>/css/main.css" type="text/css" charset="utf-8">
<link rel="stylesheet" href="<%= request.getContextPath() %>/css/prettify.css" type="text/css" charset="utf-8">

<script type="text/javascript" src="<%= request.getContextPath() %>/js/prototype.js" ></script>
<script type="text/javascript" src="<%= request.getContextPath() %>/js/prettify.js" ></script>
<script type="text/javascript">
	function doPrint () {
		 var elements = $$(".noprint");		
		 for (i = 0; i < elements.length; i++) {
			 elements[i].hide();
		 }
		 
		 window.print();
		 	 
		 for (i = 0; i < elements.length; i++) {
			 elements[i].show();
		 }
	}  

	function replaceReturn() {
		var elements = $$("div.content");		
		 for (i = 0; i < elements.length; i++) {
			 elements[i].innerHTML = elements[i].innerHTML.replace(/\n/g, "<br>");
			 elements[i].innerHTML = elements[i].innerHTML.replace("[code]", "<code class='prettyprint'>");
			 elements[i].innerHTML = elements[i].innerHTML.replace("[\/code]", "</code>");
		 }
		 prettyPrint();
	}
</script>
</head>
<body onload="replaceReturn()">
	<div id="content">
	<button onclick="doPrint()" class="noprint">打印</button>
	<a href="<%= request.getContextPath() %>/dailystandup/week/<s:date name="focus" format="yyyy-MM-dd"/>/last.action" class="noprint">上一周</a>
	<a href="<%= request.getContextPath() %>/dailystandup/week/list.action" class="noprint">今日</a>
	<a href="<%= request.getContextPath() %>/dailystandup/week/<s:date name="focus" format="yyyy-MM-dd"/>/next.action" class="noprint">下一周</a>
	<ul id="daily-standup-list">
	<s:iterator value="dailyStandups">
		<li>
			<div class="date">
				<s:date name="date" format="yyyy年MM月dd日 "/>
				<a href="<%= request.getContextPath() %>/dailystandup/date/<s:date name="date" format="yyyy-MM-dd"/>/create.action" class="noprint">新建</a>
			</div>
			<s:if test="dailyStandups.size == 0">
				<div class="placeholder">
					没有记录
				</div>
			</s:if>
			<s:else>
				<div class="daily-standup-group">
				<ul class="daily-standup-group">
					<s:iterator value="dailyStandups">
						<li class="daily-standup">
							<div class="headline">
								<div class="pair">
									<a href=""><s:property value="pair.personOne" /></a>
									<a href=""><s:property value="pair.personTwo" /></a>
								</div>
								<div class="toolbox">
									<a href="<%= request.getContextPath() %>/dailystandup/<s:property value="id"/>/modify.action" class="noprint">编辑</a>									
								</div>
								<div class="clear-both"></div>
							</div>
							<div class="section">完成</div>
							<div class="content prettyprint"><s:property value="done" /></div>
							<div class="section">计划</div>
							<div class="content prettyprint"><s:property value="todo" /></div>
							<div class="section">问题</div>
							<div class="content prettyprint"><s:property value="problem" /></div>
						</li>
					</s:iterator>
				</ul>
				<div class="clear-both"></div>
				</div>			
			</s:else>
			<div class="clear-both bottom"></div>
		</li>
	</s:iterator>
	</ul>
	</div>
</body>
</html>